package com.meatball.authorization.data.entity

import com.meatball.id.base.BaseEntity
import jakarta.persistence.*
import org.hibernate.annotations.Comment

/**
 * 角色表
 * @property id Long? 主键
 * @property name String? 名称
 * @property users Set<UserEntity>? 用户集合
 * @constructor
 */
@Entity
@Table(name = "ROLE")
@Comment("角色表")
data class RoleEntity(
    @Column(nullable = false, length = 50, unique = true)
    @Comment("角色名称")
    var name: String = "",

    @Column(length = 50)
    @Comment("角色描述")
    var description: String = "",

    @ManyToMany
    @JoinTable
    var users: Set<UserEntity> = mutableSetOf()
) : BaseEntity()
